package Text;

import java.io.FileWriter;
import java.io.IOException;

/*
 *@Student 张策
 */
public class Text3 {
    public static void main(String[] args) {
        T3 t3 = new T3();
        t3.io();
    }
}
class T3{
    public void io(){
        FileWriter fileWriter = null;
        String str="e:\\Text1.txt";
        char[]crr={'a','b','c'};
        try {
            fileWriter = new FileWriter(str);
            fileWriter.write('H');
            fileWriter.write(crr);
            fileWriter.write("为天地立心".toCharArray(),0,3);
            fileWriter.write("你好");
            fileWriter.write("错把白云揉碎",1,4);
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                if(fileWriter!=null){
                   fileWriter.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
